package com.handinfo.android.utils;

import java.io.DataInputStream;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;

import com.handinfo.android.DWGameManager;
import com.handinfo.android.core.resource.ResourceVerifier;
import com.handinfo.android.uicontrols.controls.DWTabPage;

public class OChannelOperation
{
	/**
	 * 登录
	 */
	public static void login()
	{
		
	}
	/**
	 * 重新登录
	 */
	public static void returnLogin()
	{
		
	}
	/**
	 * 检查资源版本
	 */
	public static void checkVersion()
	{
		
	}
	/**
	 * 初始化渠道接口
	 */
	public static  void initChannel()
	{
	}
	/**
	 * 使用渠道 Sdk支付
	 */
	public static void  sdkPay(){
		
	}
	public static void outGame(){
		
	}
	public static void doonYYH(int requestCode, int resultCode, Intent data){
		
	}
	/**
	 * 进入渠道社区
	 */
	public static void intoSdkSheQu(){
		
	}
	/**
	 * 进入社区 的控件
	 */
	public static void addButtonSheQu(DWTabPage m_stTabPage03, Bitmap m_stBitmap04, Bitmap m_stBitmap05){
		
	}
	
	/**
	 * 充值窗体
	 */
	public static void openChongZhiWindow( ){
		
	}
	/**
	 * 把zip 拷贝到SD卡中出错
	 * 
	 */
	public static void assetsToSDcardError(){
		if (DWGameManager.getInstance().getGameHandler() instanceof ResourceVerifier) {
			((ResourceVerifier)DWGameManager.getInstance().getGameHandler()).setState(ResourceVerifier.LOGIC_Waite);
		}
		final Activity contextCurr = DWGameManager.getInstance().getCurrentActivity();
		DWGameManager.getInstance().getCurrentActivity().mHandler.post(new Runnable() {
			
			public void run()
			{
				new AlertDialog.Builder(contextCurr).setTitle("初始化提示").setIcon(null).setMessage(
				"SD卡无法写入数据，请检查SD卡或重启手机。").setPositiveButton("确定",
				new DialogInterface.OnClickListener() {

					public void onClick(DialogInterface dialog, int which)
					{
						DWGameManager.getInstance().destroy();
					}
				}).create().show();
				
			}
		});
	}
	/**
	 * 下载资源 中出错
	 * 
	 */
	public static void downloadZipsError(){
		if (DWGameManager.getInstance().getGameHandler() instanceof ResourceVerifier) {
			((ResourceVerifier)DWGameManager.getInstance().getGameHandler()).setState(ResourceVerifier.LOGIC_Waite);
		}
		final Activity contextCurr = DWGameManager.getInstance().getCurrentActivity();
		DWGameManager.getInstance().getCurrentActivity().mHandler.post(new Runnable() {
			
			public void run()
			{
				new AlertDialog.Builder(contextCurr).setTitle("下载提示").setIcon(null).setMessage(
				"SD卡无法写入数据，请检查SD卡或重启手机。").setPositiveButton("确定",
				new DialogInterface.OnClickListener() {

					public void onClick(DialogInterface dialog, int which)
					{
						DWGameManager.getInstance().destroy();
					}
				}).create().show();
				
			}
		});
	}
//	android.os.Environment.getExternalStorageDirectory().canWrite()
	public  static void DWonCreate(Context con){
		
	}
	public static void DWonStart(Context con){
		
	}
	public static void DWonResume(Context con){
		
	}
	public static void DWonPause(Context con){
		
	}
	public static void DWonDestroy(Context con){
		
	}
	public static void onConfigurationChanged(Activity activity,Configuration newConfig){
		
	}
	/**
	 * 进入游戏场景
	 */
	public static void enterGame(){
		
	}
	/**
	 * 创建角色
	 */
	public static void createRole(){
		
	}
	/**
	 * 刷新token等数据
	 */
	public static void recvUserrefresh(DataInputStream dis){
		
	}
	public static void doLoginToken(){
		
	}
}
